This file is a Mathematica Notebook that gives some examples of what Mathematica can do. For information on how to read this Notebook, see the file Read This First!
This file is loosely based on the ÒTour of MathematicaÓ in Mathematica: A System for Doing Mathematics by Computer, Second Edition, by Stephen Wolfram. This book was published by Addison-Wesley in 1991, and is available at most bookstores. For information on how to obtain copies of Mathematica itself, see the section ÒBuying Mathematica Ó in the file Read This First!
The first line here is what you type into Mathematica. The second line is the result Mathematica gives. If you are reading this Notebook on a color system, the input and output are blue, with the input in boldface.
Many integrals do not have a Òclosed form solutionÓ. If you give Mathematica such a definite integral it will be returned unevaluated. You can still use N to get a numerical answer.
Mathematica can also solve differential equations. Here is a pair of simultaneous differential equations. The solution you get involves two undetermined coefficients.
It is a mathematical fact that most differential equations do not have an explicit symbolic solution. In these cases you can get a numerical approximation to the solution using NDSolve. After the solution is computed it is plotted.
It is a fact of mathematics that there is no way to get an exact formula for the solutions of a quintic equation like this. You can nevertheless ask Mathematica to give you numerical results. You get the five complex number roots to the equation.
When equations contain complicated functions there is in general no systematic procedure for finding all solutions, even numerically. The Mathematica function FindRoot searches for a numerical solution to an equation, starting at a specified point.
Mathematica generates all graphics in PostScript, so that you can resize pictures, and make use of the resolution available on different types of printers. (Note, however, that to save disk space the graphics in this Notebook have been converted into bitmap images, which have lower resolution and do not look as good when resized or printed. The ability to convert images into bitmap form is useful when space is at a premium, and for animations, which are normally not printed.)
This Notebook contains a sample of animation in Mathematica. Due to disk space limitations, this is a simple black and white example. Look at the Color Movie Notebook on your disk for an example of animated color graphics.
To play a sound, double-click the small, speaker-shaped icon at the top of the sound cell bracket. Note: When you double-click the sound cell itself, Mathematica treats it as an animated graphic and plays it repeatedly. To stop, click again anywhere.
This loads in a package that defines properties of polyhedra.
The package defines, among other things, the geometry of a dodecahedron. The Vertices function gives the coordinates for the faces of the given polyhedron.
Here are the vertices for a dodecahedron shown in shortened form.
As another example, we can use the definitions from the polyhedra package to create an image of a stellated icosahedron, which is often used as an icon for the Mathematica system.
There are several styles of programming in Mathematica. One of them is procedural programming, as you would find in a standard structured programming language such as C or Pascal.
Another is Òrule-based programmingÓ. The idea is to give transformation rules which specify how Mathematica should transform expressions it receives as input.
You can give rules that mimic the formulas you might find in a mathematics textbook.
Here is an example of how you might teach Mathematica about a new form of logarithm function, called nlog.
Another style of programming you can use in Mathematica is functional programming. In functional programming, you specify a collection of functions to apply. This style of programming often yields compact, elegant programs that make good use of Mathematica's many integrated capabilities.
Mathematica consists of two parts Ñ the ÒkernelÓ, which actually does computations, and the Òfront endÓ, which deals with interaction with the user. The kernel of Mathematica is essentially the same on all computers that support Mathematica. The front end, on the other hand, works differently on different kinds of computer.
On the Macintosh, Mathematica has a sophisticated front end that takes advantage of the Macintosh's unique user interface capabilities. (You can actually use the Macintosh front end even if you are using a Òremote kernelÓ, say on a supercomputer connected through a network.)
One of the most important aspects of the Macintosh front end is its ability to support Mathematica ÒNotebooksÓ.
This file is an example of a Notebook. Notebooks consist of a mixture of text, graphics, sounds and Mathematica input.
Notebooks can be used like Òinteractive textbooksÓ Ñ you read the text in the Notebook, then use the Mathematica input in the Notebook to perform calculations.
This Notebook defines the functions PointPlot, PointPlot3D, PointParamPlot3D, SpaceCurve, and PointSpaceCurve. These functions let you make discrete point plots in two and three dimensions. The SpaceCurve and PointSpaceCurve functions let you make three-dimensional functions of one parameter (lines or points in 3D).
Each of the functions defined in this Notebook is a variation of either Plot, Plot3D, or ParametricPlot3D. The arguments are quite similar to these standard functions.
Following are descriptions of each of the functions.